import { NestFactory } from '@nestjs/core';
import { AppModule } from './modules/app/app.module';
import { ResponesInterceptor, } from './interceptors/response.interceptor'
import { ErrorInterceptor } from './interceptors/error.interceptors'
import { static as static_ } from 'express'

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.enableCors()
  app.useGlobalInterceptors(new ResponesInterceptor())
  app.useGlobalInterceptors(new ErrorInterceptor())
  app.use('/public', static_('uploads'))
  await app.listen(3000);
}
bootstrap();
